
import State from '../State';
import Element, { IObject3DMap } from '../State/Element';
import getObject3D from './getObject3D';

export default async function sceneAdd(s: State, element?: Element<keyof IObject3DMap>) {
    if (!element) return;

    const object3D = getObject3D(element);
    if (!object3D) return;

    s.scene?.add(object3D);
    s.elementMap.set(element.uuid, element);
    s.elementMap = new Map(s.elementMap);
}

